/*jslint adsafe:false, 
 bitwise: true, 
 browser:true, 
 cap:false, 
 debug:false,
 eqeqeq: true,
 evil: false,
 forin: false,
 fragment:false, 
 laxbreak:false, 
 nomen:true, 
 on:false,
 passfail:false, 
 plusplus:true, 
 rhino:false, 
 undef:true, 
 white:false, 
 widget:false */

/*extern RadioStar */

/**
 * @memberOf RadioStar
 * @name widget
 * @static
 * @type object
 * @description The main singleton of the Radio Star widget.
 */
RadioStar.widget = function(Debug, File, Stations) 
{
  // Private Variables
  var that,
  currentStation,
  visible = true;
  
  // Private methods
  
  
  // Public methods
  return /** @scope widget */ {
    /**
     * @memberOf widget
     * @description Initialization function for widget.
     */
    init: function()
    {
      if(!that)
      {
        that = this;
      }
    },
    
    /**
     * @memberOf widget
     * @function onShow
     * @description Run when Dashboard is shown.
     */
    onShow: function () 
    {
      try
      {
        visible = true;
      }
      catch (error)
      {
        Debug.alert("Error in widget.onShow: " + error);
      }
    },
    
    /**
     * @memberOf widget
     * @function onHide
     * @description Run when Dashboard is hidden.
     */
    onHide: function () 
    {
      try
      {
        visible = false;
        if(currentStation)
        {
          currentStation.stopDownloading
        }
      }
      catch (error)
      {
        Debug.alert("Error in widget.onHide: " + error);
      }
    }
  };
}(EPG.debug, EPG.file, RadioStar.Stations);
RadioStar.widget.init();
